<template>
  <div class="main">
    <div class="chart">
      <GlobalGl :lineData="lineData" />
    </div>
  </div>
</template>

<script lang="ts" setup>
import { onBeforeMount, reactive } from "vue";
import GlobalGl from "@/components/GlobalGl/index.vue";
import axios from "axios";
import { mockData } from "@/utils/mock";

let lineData = reactive<any>({
  data: [],
});

const getLineData = () => {
  axios.get("/data.json").then((res) => {
    lineData.data = mockData(res.data);
  });
};

onBeforeMount(() => {
  getLineData();
});
</script>
<style lang="less" scoped>
.main {
  width: 100%;
  height: 100vh;
  .chart {
    width: 100%;
    height: 500px;
  }
}
</style>
